<!--  -->
<template>
  首页
  <el-button @click="asd">
    {{ $store.state.isCollapse }}
  </el-button>
  <el-date-picker
    v-model="value1"
    type="date"
    placeholder="选择日期"
  />
</template>

<script lang="ts" setup>
import { ref } from 'vue'

import { getLoginInfo } from '@/api/common'
// 在script setup中导入接口类型需要加type
import type { ILoginInfo } from '@/api/types/common'
import { useStore } from '@/store'

// list的类型为接口中的slide
const list = ref<ILoginInfo['slide']>([])

getLoginInfo().then(res => {
  list.value = res.slide
})

const value1 = ref('')

const store = useStore()

function asd () {
  store.commit('setIsCollapse', !store.state.isCollapse)
}

</script>

<style scoped>

</style>
